<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../lib/html5shiv.js"></script>
    <script type="text/javascript" src="../lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>编辑类型</title>
    <style>
        #DataTables_Table_0_filter {
            margin-bottom: 15px;
        }
        #DataTables_Table_0_filter input {
            margin-left: 8px;
        }
    </style>
</head>
<body>
<article class="page-container">
    <div class="mt-20">
        <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
            <thead>
            <tr class="text-c">
                <th width="25"><input type="checkbox" name="" value=""></th>
                <th width="80">ID</th>
                <th width="180">所属类型</th>
                <th width="200">书籍名</th>
                <th width="200">书籍作者</th>
                <th width="200">书籍出版社</th>
                <th width="200">书籍出版时间</th>
                <th width="120">书籍价格</th>
                <th width="120">库存</th>
            </tr>
            </thead>
            <tbody>
            <c:forEach items="${books}" var="item">
                <tr class="text-c">
                    <td><input type="checkbox" value="" name="checkId" data-id="${item.id}" autocomplete="off"></td>
                    <td>${item.id}</td>
                    <td>${item.booksType.typeName}</td>
                    <td>${item.bookName}</td>
                    <td>${item.bookAuthor}</td>
                    <td>${item.bookPublished}</td>
                    <td>${item.bookTime}</td>
                    <td>¥${item.bookPrice}</td>
                    <td>${item.bookStock}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
    <div style="margin: 36px 0 0; text-align: right">
        <button type="button" class="btn btn-primary" onclick="nextOrder()">下一步</button>
    </div>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="../lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="../lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="../lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">
    $(function () {

        $('.table-sort').dataTable({
            "aaSorting": [[1, "desc"]],//默认第几个排序
            "searching": true,
            "paging": false,
            "aoColumnDefs": [
                {"orderable": false, "aTargets": [0, 5]}// 不参与排序的列
            ]
        });
    });


    /*批量删除*/
    function nextOrder() {
        let selectIds = $("input[name='checkId']:checked");
        let selectCount = selectIds.length;
        if (selectCount == 0) {
            layer.msg("请选择要购买的书籍！", {"icon": 7})
            return;
        }
        let ids = '';
        for (let i = 0; i < selectIds.length; i++) {
            ids += $(selectIds[i]).attr("data-id") + ",";
        }
        window.location.href = "toInputNumPage?ids="+ids.substring(0, ids.length);
    }

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>